﻿<%@ Page Title="" Language="C#" MasterPageFile="~/TsSite.Master" AutoEventWireup="true" CodeBehind="BusinessCustomerList.aspx.cs" Inherits="TireService.Web.Casehandling.BusinessCustomerList" %>

<%@ Register assembly="DevExpress.Web.v11.1, Version=11.1.12.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxPanel" tagprefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v11.1, Version=11.1.12.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxRoundPanel" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.ASPxGridView.v11.1.Export, Version=11.1.12.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxGridView.Export" TagPrefix="dxwgv" %>
<%@ Register assembly="DevExpress.Web.ASPxGridView.v11.1, Version=11.1.12.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxGridView" tagprefix="dxwgv" %>
<%@ Register assembly="DevExpress.Web.ASPxEditors.v11.1, Version=11.1.12.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxEditors" tagprefix="dxe" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <script src="../Scripts/ModalPopup.js" type="text/javascript"></script>
    
    <dx:ASPxRoundPanel ID="rpContent" runat="server" Width="100%" ShowHeader="true" Height="100%">
        <PanelCollection>
            <dx:PanelContent ID="PanelContent1" runat="server">
                
                <asp:UpdatePanel ID="upMessage" runat="server" UpdateMode="Conditional">
                    <ContentTemplate>
                        <table border="0" cellspacing="0" cellpadding="5">
                            <tr>
                                <td>
                                    <div style="font-family: Tahoma; font-size: 9pt; font-weight: normal; color: #f15e34">
                                        &nbsp;<asp:Literal ID="lMessage" runat="server"></asp:Literal>
                                    </div>
                                </td>
                            </tr>
                        </table>          
                    </ContentTemplate>
                </asp:UpdatePanel>
                
                <asp:UpdatePanel ID="upCustomerAction" runat="server">
                    <ContentTemplate>
                        <table border="0" cellspacing="0" cellpadding="5" width="100%">
                            <tr>
                                <td>
                                    <asp:DropDownList ID="ddlAction" runat="server">
                                        <asp:ListItem Selected="True" Value="0">-- Handling --</asp:ListItem>
                                        <%--<asp:ListItem Value="1">Rediger valgte</asp:ListItem>--%>
                                    </asp:DropDownList>
                                    &nbsp;
                                    <asp:Button ID="btnSubmitAction" runat="server" Text="Udfør" 
                                        onclick="btnSubmitAction_Click" />
                                    &nbsp;
                                    <asp:Button ID="btnNewCustomer" runat="server" Text="Ny kunde" 
                                        onclick="btnNewCustomer_Click" />
                                    &nbsp;
                                    <asp:DropDownList ID="ddlExport" runat="server">
                                        <asp:ListItem Selected="True" Value="0">Export pdf</asp:ListItem>
                                        <asp:ListItem Value="1">Export xls</asp:ListItem>
                                        <asp:ListItem Value="2">Export csv</asp:ListItem>
                                        <asp:ListItem Value="3">Export rtf</asp:ListItem>
                                    </asp:DropDownList>
                                    &nbsp;
                                    <asp:Button ID="btnExport" runat="server" CausesValidation="False" 
                                        Text="Exporter" onclick="btnExport_Click" />
                                </td>
                                <td align="right">
                                    <asp:Label ID="lblView" runat="server" Text="Visning"></asp:Label>
                                    <asp:DropDownList ID="ddlView" runat="server" AutoPostBack="True" 
                                        onselectedindexchanged="ddlView_SelectedIndexChanged">
                                        <asp:ListItem Value="0">Ingen gruppering</asp:ListItem>
                                        <asp:ListItem Value="1">Grupper efter By</asp:ListItem>
                                    </asp:DropDownList>
                                    &nbsp;
                                    <asp:Label ID="lblPageSize" runat="server" Text="Antal linjer pr side"></asp:Label>
                                    <asp:DropDownList ID="ddlPageSize" runat="server" AutoPostBack="true">
                                        <asp:ListItem Value="10">10</asp:ListItem>
                                        <asp:ListItem Value="25">25</asp:ListItem>
                                        <asp:ListItem Value="50">50</asp:ListItem>
                                        <asp:ListItem Value="100">100</asp:ListItem>
                                    </asp:DropDownList>
                                </td>
                            </tr>
                        </table>          
                    </ContentTemplate>    
                </asp:UpdatePanel>
                
                <asp:UpdatePanel ID="upCustomer" runat="server">
                    <ContentTemplate>
                        <dxwgv:ASPxGridView ID="gvCustomer" runat="server" ClientInstanceName="gvCustomer" 
                            KeyFieldName="CustomerId" Width="100%" AutoGenerateColumns="False" EnableCallBacks="False" 
                            oncustomunboundcolumndata="gvCustomer_CustomUnboundColumnData" 
                            oncustombuttoncallback="gvCustomer_CustomButtonCallback">
                            <SettingsLoadingPanel Text="Henter&amp;hellip;" />
                            <Settings ShowHeaderFilterButton="true" ShowGroupPanel="true" ShowFilterRow="True" />
                            <SettingsPager AlwaysShowPager="True" PageSize="20" Position="TopAndBottom">
                                <Summary 
                                    AllPagesText="Sider: {0} - {1} ({2} kunder)" 
                                    Text="Side {0} af {1} ({2} kunder)" />
                            </SettingsPager>
                            <SettingsText ConfirmDelete="Vil du slette denne kunde?" GroupPanel="Træk kolonne hertil for at gruppere efter den" HeaderFilterShowAll="Vis alle" />
                            <SettingsBehavior ConfirmDelete="True" AllowGroup="true" AllowDragDrop="true" />
                            
                            <Columns>
                                <dxwgv:GridViewCommandColumn ShowSelectCheckbox="True" VisibleIndex="0">
                                     <HeaderTemplate>
                                         <input type="checkbox" onclick="gvCustomer.SelectAllRowsOnPage(this.checked);" style="vertical-align:middle;" title="Vælg/Fravælg alle linjer på siden"></input>
                                     </HeaderTemplate>
                                     <HeaderStyle Paddings-PaddingTop="1" Paddings-PaddingBottom="1" 
                                         HorizontalAlign="Center">
                                        <Paddings PaddingTop="1px" PaddingBottom="1px"></Paddings>
                                     </HeaderStyle>
                                </dxwgv:GridViewCommandColumn>
                                <dxwgv:GridViewCommandColumn VisibleIndex="1">
                                    <CustomButtons>
                                        <dxwgv:GridViewCommandColumnCustomButton Text="Rediger" ID="Edit" />
                                    </CustomButtons>
                                </dxwgv:GridViewCommandColumn>
                                <dxwgv:GridViewDataHyperLinkColumn FieldName="CustomerId" VisibleIndex="2" Caption="Abonnementer">
                                    <PropertiesHyperLinkEdit NavigateUrlFormatString="~/Casehandling/EditCustomer.aspx?CustomerId={0}&Area=Subscription" Text="Vis">
                                    </PropertiesHyperLinkEdit>
                                </dxwgv:GridViewDataHyperLinkColumn>
                                <dxwgv:GridViewDataHyperLinkColumn FieldName="CustomerId" VisibleIndex="2" Caption="Biler">
                                    <PropertiesHyperLinkEdit NavigateUrlFormatString="~/Casehandling/EditCustomer.aspx?CustomerId={0}&Area=Car" Text="Vis">
                                    </PropertiesHyperLinkEdit>
                                </dxwgv:GridViewDataHyperLinkColumn>
                                <dxwgv:GridViewDataHyperLinkColumn FieldName="CustomerId" VisibleIndex="2" Caption="Dæksæt">
                                    <PropertiesHyperLinkEdit NavigateUrlFormatString="~/Casehandling/EditCustomer.aspx?CustomerId={0}&Area=TireSet" Text="Vis">
                                    </PropertiesHyperLinkEdit>
                                </dxwgv:GridViewDataHyperLinkColumn>
                                <dxwgv:GridViewDataColumn FieldName="CustomerId" VisibleIndex="2" Caption="Kundenr">
                                </dxwgv:GridViewDataColumn>
                                <dxwgv:GridViewDataColumn FieldName="CompanyName" VisibleIndex="3" Caption="Firma">
                                </dxwgv:GridViewDataColumn>
                                <dxwgv:GridViewDataColumn FieldName="Name" VisibleIndex="3" Caption="Navn">
                                </dxwgv:GridViewDataColumn>
                                <dxwgv:GridViewDataColumn FieldName="Address" VisibleIndex="4" Caption="Adresse">
                                </dxwgv:GridViewDataColumn>
                                <dxwgv:GridViewDataColumn FieldName="ZipCode" VisibleIndex="5" Caption="Postnr">
                                </dxwgv:GridViewDataColumn>
                                <dxwgv:GridViewDataColumn FieldName="City" VisibleIndex="6" Caption="By">
                                </dxwgv:GridViewDataColumn>
                                <dxwgv:GridViewDataColumn FieldName="CountryId" VisibleIndex="7" Caption="CountryId" Visible="false">
                                </dxwgv:GridViewDataColumn>
                                <dxwgv:GridViewDataTextColumn FieldName="CountryName" VisibleIndex="8" UnboundType="String" Caption="Land">
                                </dxwgv:GridViewDataTextColumn>
                                <dxwgv:GridViewDataColumn FieldName="SecondaryAddress" VisibleIndex="9" Caption="Sekundær Adresse">
                                </dxwgv:GridViewDataColumn>
                                <dxwgv:GridViewDataColumn FieldName="SecondaryZipCode" VisibleIndex="10" Caption="Sekundær Postnr">
                                </dxwgv:GridViewDataColumn>
                                <dxwgv:GridViewDataColumn FieldName="SecondaryCity" VisibleIndex="11" Caption="Sekundær By">
                                </dxwgv:GridViewDataColumn>
                                <dxwgv:GridViewDataColumn FieldName="Phone1" VisibleIndex="12" Caption="Telefon">
                                </dxwgv:GridViewDataColumn>
                                <dxwgv:GridViewDataColumn FieldName="Phone2" VisibleIndex="13" Caption="Telefon2">
                                </dxwgv:GridViewDataColumn>
                                <dxwgv:GridViewDataColumn FieldName="Email" VisibleIndex="14" Caption="Email">
                                </dxwgv:GridViewDataColumn>
                            </Columns>
                            
                        </dxwgv:ASPxGridView>
                    </ContentTemplate>
                </asp:UpdatePanel>
                
                
                <dxwgv:ASPxGridViewExporter ID="gvExport" runat="server" GridViewID="gvCustomer">
                </dxwgv:ASPxGridViewExporter>
                
            </dx:PanelContent>
        </PanelCollection>
        <HeaderTemplate>
            <table cellpadding="0" cellspacing="2" border="0">
                <tr>
                    <td>
                        <img id="imgCustomer" alt="" src="~/Images/Medium/businessmen.png" runat="server" style="width: 32px; height: 32px" />
                    </td>
                    <td valign="middle">
                        <h3><asp:Label ID="lblCustomerHeader" runat="server" Text="Erhvervs kunder"></asp:Label></h3>
                    </td>
                </tr>
            </table>
        </HeaderTemplate>
    </dx:ASPxRoundPanel>

</asp:Content>
